<div class="row">
    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
        <div class="widget am-cf">
            <div class="widget-head am-cf">
                <div class="widget-title am-cf">板块列表</div>
            </div>
            <div class="widget-body am-fr">
               <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                  <div class="am-form-group">
                    <div class="am-btn-toolbar">
                          <div class="am-btn-group am-btn-group-xs">
                               <a class="am-btn am-btn-default am-btn-success am-radius"
                                href="<?= url('store.store/add') ?>">
                                   <span class="am-icon-plus"></span> 新增
                               </a>
                            </div>
                        </div>
                    </div>
               </div>
                <!-- 工具栏 -->
                <div class="page_toolbar am-margin-bottom-xl am-cf">
                    <form id="form-search" class="toolbar-form" action="">
                        <input type="hidden" name="s" value="/<?= $request->pathinfo() ?>">
                        <div class="am fr">
                            <div class="am-form-group am-fl">
                                <div class="am-input-group am-input-group-sm tpl-form-border-form">
                                    <input type="text" class="am-form-field" name="search"
                                           placeholder="板块名称"
                                           value="<?= $request->get('search') ?>">
                                    <div class="am-input-group-btn">
                                        <button class="am-btn am-btn-default am-icon-search" type="submit"></button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="am-u-sm-12">
                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                        <thead>
                        <tr>
                            <th>板块id</th>
                            <th>板块名称</th>
                            <th>添加时间</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                            <tr>
                                <td class="am-text-middle">
                                    <p class="item-title"><?= $item['id'] ?></p>
                                </td>
                                <td class="am-text-middle">
                                    <p class="item-title"><?= $item['name'] ?></p>
                                </td>
                                <td class="am-text-middle"><?= date('Y-m-d H:i:s',$item['createTime']) ?></td>
                                <td class="am-text-middle">
                                    <?php if ($item['status']==1)
                                        echo '正常';
                                    else
                                        echo '已删除';
                                    ?>
                                </td>
                                <td class="am-text-middle">
                                    <?php if ($item['status']==1): ?>
                                        <div class="tpl-table-black-operation">
<!--                                            <a href="javascript:void(0);" class="j-delete tpl-table-black-operation-del"-->
<!--                                               data-id="--><?//= $item['id'] ?><!--">-->
<!--                                                <i class="am-icon-trash"></i> 删除-->
<!--                                            </a>-->
                                            <a href="<?= url('store.store/edit', ['id' => $item['id']]) ?>"
                                               class="j-move" data-id="<?= $item['id'] ?>">
                                                <i class="am-icon-arrow-right"></i> 编辑
                                            </a>
                                        </div>
                                    <?php endif; ?> <?php if ($item['status']==2): ?>
                                        <div class="tpl-table-black-operation">
                                            <a href="javascript:void(0);" class="j-recover tpl-table-black-operation-del"
                                               data-id="<?= $item['id'] ?>">
                                                <i class="am-icon-trash"></i> 恢复
                                            </a>
                                        </div>
                                    <?php endif; ?>


                                </td>
                            </tr>
                        <?php endforeach; else: ?>
                            <tr>
                                <td colspan="5" class="am-text-center">暂无记录</td>
                            </tr>
                        <?php endif; ?>
                        </tbody>
                    </table>
                </div>
                <div class="am-u-lg-12 am-cf">
                    <div class="am-fr"><?= $list->render() ?> </div>
                    <div class="am-fr pagination-total am-margin-right">
                        <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        // 删除元素
        var url = "<?= url('store.store/delete') ?>";
        $('.j-delete').delete('id', url, '确定要删除吗？');
        //恢复元素
        var url = "<?= url('store.store/recover') ?>";
        $('.j-recover').delete('id', url, '确定要恢复吗？');
    });
</script>

